// Copyright 2019 JDAI Inc.
// License ()
// Author:  XXXXXXX (), XXXX@jd.com
// Filename:  Log.h
// Description:
// Created:  08/20/21 19:56:19
// Version:  1.0
// Company:  JDAI
#ifndef Log_H_
#define Log_H_

#define LogD(fmt, args...) Log::Print(Log::D, fmt, TAG.c_str(), __func__, __LINE__,  ##args)
#define LogI(fmt, args...) Log::Print(Log::I, fmt, TAG.c_str(), __func__, __LINE__,  ##args)
#define LogW(fmt, args...) Log::Print(Log::W, fmt, TAG.c_str(), __func__, __LINE__,  ##args)
#define LogE(fmt, args...) Log::Print(Log::E, fmt, TAG.c_str(), __func__, __LINE__,  ##args)

class Log {
public:
    Log();
    ~Log();
    static bool Init(char* conf);
    static void Print(int level, char const* fmt, const char* file, const char* func, const int line, ...);

public:
    static int gmLogLevel;
    const static int T = 0; //0
    const static int D = 1; //10000
    const static int I = 2; //20000
    const static int W = 3; // 30000
    const static int E = 4; //40000
    const static int F = 5;
    const static int OFF = 6;

};

#endif
